﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace KorbeVCP.Controls
{
    public partial class Canvas : PictureBox
    {
        public Canvas()
        {
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.DoubleBuffered = true;
        }

        protected override void Dispose(bool disposable)
        {
            base.Dispose(disposable);
        }

        public virtual void Initialize()
        {
            this.Paint += CanvasPaint;
        }

        private void CanvasPaint(object sender, PaintEventArgs e)
        {
            e.Graphics.DrawEllipse(new Pen(Color.Red), 0, 0, 100, 100);

            e.Graphics.DrawImage(Properties.Resources.SketchNormal, 0, 0);
        }


        //public Viewer Viewer { get; set; }
    }
}
